home *** CD-ROM | disk | FTP | other *** search
- on GliAppleEvent____________________
- end
-
- on InitAppleScript
- global gASCheckBoxNameList, gASCheckBoxSpriteList, gASRadioButtonNameList, gASRadioButtonSpriteList
- set gASCheckBoxNameList to ["BeepWhenDone", "SaveLogFile", "RememberFolders", "ExactBackUp", "Invisible", "UnlockFile"]
- set gASCheckBoxSpriteList to [11, 14, 5, 17, 20, 23]
- set gASRadioButtonNameList to ["OnErrorDo"]
- set gASRadioButtonSpriteList to [28]
- end
-
- on ASBackUp Sorgente, Destinazione
- global gOneDirection
- set gOneDirection to 1
- DomyAppleEvent(Sorgente, Destinazione)
- end
-
- on ASSynchronize Sorgente, Destinazione
- global gOneDirection, gBigTextLog
- set gOneDirection to 0
- DomyAppleEvent(Sorgente, Destinazione)
- end
-
- on DomyAppleEvent Sorgente, Destinazione
- global gSourceFolder, gDestFolder, gOneDirection, gBigTextLog, gSaveLogFile
- if not voidp(Sorgente) and (Sorgente <> EMPTY) then
- set gSourceFolder to Sorgente
- end if
- if not voidp(Destinazione) and (Destinazione <> EMPTY) then
- set gDestFolder to Destinazione
- end if
- put AccorciaNome(gSourceFolder) into field "fSourceFolder"
- put AccorciaNome(gDestFolder) into field "fDestFolder"
- CheckOneDirection()
- CheckSyncButton()
- GoLista()
- set err to DoSynchronize()
- if err then
- set gBigTextLog to field "P4" && "from:" & RETURN & gSourceFolder && "to:" & RETURN & gDestFolder & RETURN & RETURN
- put "Start at:" && the long date && "-" && the long time & RETURN & "--" & RETURN after gBigTextLog
- beep(1)
- case err of
- 1:
- set message to "Source Folder not defined. Calling by AppleScript stopped."
- 2:
- set message to "Destination Folder not defined. Calling by AppleScript stopped."
- 3:
- set message to "Source Folder not found. Calling by AppleScript stopped."
- 4:
- set message to "Destination Folder not found. Calling by AppleScript stopped."
- end case
- put message & RETURN & "No tasks done." after gBigTextLog
- if gSaveLogFile then
- SaveLogFile()
- end if
- set gBigTextLog to EMPTY
- end if
- end
-
- on ASSetCheckBox checkName, checkValue
- global gASCheckBoxNameList, gASCheckBoxSpriteList, gBeepWhenDone, gSaveLogFile, gRememberFolders, gDestructive, gInvisible, gUnlockFile
- if voidp(checkName) or (checkName = EMPTY) then
- return -1
- end if
- set myPos to getPos(gASCheckBoxNameList, checkName)
- if myPos = 0 then
- return -1
- end if
- if voidp(checkValue) or ((checkValue <> 0) and (checkValue <> 1)) then
- return -2
- end if
- case myPos of
- 1:
- set gBeepWhenDone to checkValue
- 2:
- set gSaveLogFile to checkValue
- 3:
- set gRememberFolders to checkValue
- 4:
- set gDestructive to checkValue
- 5:
- set gInvisible to checkValue
- 6:
- set gUnlockFile to checkValue
- end case
- if the frameLabel = "Info" then
- set mySprite to getAt(gASCheckBoxSpriteList, myPos)
- set the member of sprite mySprite to "BtnUpCHK" & checkValue
- updateStage()
- end if
- return 0
- end
-
- on ASSetRadioButton checkName, checkValue
- global gASRadioButtonNameList, gASRadioButtonSpriteList, gOnErrorDo
- if voidp(checkName) or (checkName = EMPTY) then
- return -1
- end if
- set myPos to getPos(gASRadioButtonNameList, checkName)
- if myPos = 0 then
- return -1
- end if
- if voidp(checkValue) or ((checkValue <> 0) and (checkValue <> 1)) then
- return -2
- end if
- case myPos of
- 1:
- set gOnErrorDo to checkValue
- end case
- if the frameLabel = "Info" then
- SetRadiogOnErrorDo()
- updateStage()
- end if
- return 0
- end
-